<?php

namespace app\admin\model;

use think\Model;


class Jieziarea extends Model
{

    

    

    // 表名
    protected $name = 'jieziarea';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'of_level_text'
    ];

    public function getOfLevelList()
    {
        return ['1' => __('Of_level 1'), '2' => __('Of_level 2'), '3' => __('Of_level 3'), '4' => __('Of_level 4'), '5' => __('Of_level 5'), '6' => __('Of_level 6')];
    }

    public function getOfLevelTextAttr($value, $data)
    {
        $value = $value ? $value : $data['of_level'];
        $list = $this->getOfLevelList();
        return isset($list[$value]) ? $list[$value] : '';
    }
}
